package com.wanghengzhi.kata;

/**
 * @author wanghengzhi
 * @since 2021/11/7 22:04
 */
public class BackstagePass extends Goods {
    public BackstagePass(double quality, int sellIn) {
        super("Backstage Pass",  quality, sellIn);
    }

    @Override
    public void updateByDay() {
        increaseByOneIfQualityLessThanFifty();
        decreaseSellInByOne();
        if (sellIn < 10) {
            increaseByOneIfQualityLessThanFifty();
        }
        if (sellIn < 5) {
            increaseByOneIfQualityLessThanFifty();
        }
        if (sellIn < 0) {
            quality = 0;
        }
    }
}
